<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <title>Title</title>
</head>
<body>

<input type="text" id="user">
<input type="button" onclick="GetData();" value="submit">

<script>
    function GetData() {
        var i = document.getElementById('user');
        alert(i.value);
    }
</script>


</body>
</html>